using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ProgramFunctionTab : MonoBehaviour
{
    public Button m_LogicButton;
    public Button m_ParameterButton;

    public GameObject m_LogicListPanel;
    public GameObject m_LogicParameterPanel;
    public GameObject m_PartParameterListPanel;
    public GameObject m_PartParameterParametrPanel;

    public Color m_SelectedColor;
    public Color m_UnselectedColor;
    void Start()
    {
        OnLogicClicked();
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public void OnLogicClicked()
    {
        var imageParameter = m_ParameterButton.gameObject.GetComponent<Image>();
        var imageLogic = m_LogicButton.gameObject.GetComponent<Image>();
        imageParameter.color = m_UnselectedColor;
        imageLogic.color = m_SelectedColor;

        m_LogicListPanel.gameObject.SetActive(true);
        m_LogicParameterPanel.gameObject.SetActive(true);
        m_PartParameterListPanel.gameObject.SetActive(false);
        m_PartParameterParametrPanel.gameObject.SetActive(false);
    }
    public void OnParameterClicked()
    {
        var imageParameter = m_ParameterButton.gameObject.GetComponent<Image>();
        var imageLogic = m_LogicButton.gameObject.GetComponent<Image>();
        imageParameter.color = m_SelectedColor;
        imageLogic.color = m_UnselectedColor;

        m_LogicListPanel.gameObject.SetActive(false);
        m_LogicParameterPanel.gameObject.SetActive(false);
        m_PartParameterListPanel.gameObject.SetActive(true);
        m_PartParameterParametrPanel.gameObject.SetActive(true);
    }
}
